# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import JSONConvertionConstants

class JSONConvertionSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(JSONConvertionSubDirectiveTree, self).__init__(parent)
        self.createJSONConvertionTreeNode()

    def createJSONConvertionTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "JSONConvertion"
        self.setText(0,"JSON转换")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, JSONConvertionConstants.JSONConvertionConstants.convertingToTextDirective, "转换成文本")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, JSONConvertionConstants.JSONConvertionConstants.convertingToJSONObjectDirective, "转换成JSON对象")